package com.sdgroup.jmete.controller;

import com.sdgroup.jmete.service.JmeterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

/**
 * @description: 接口
 * @author: 李文
 * @create: 2021-05-03 21:51
 **/
@RestController
@RefreshScope
public class IndexJmeterController {

    @Autowired
    JmeterService jmeterService;

    @Value("${usernam:me}")
    private String usernam;

    @RequestMapping("/username")
    public String get() {
        return usernam;
    }


    @GetMapping("/Jmeterrpc")
    public Object getRpc(String name) {
        HashMap<String, Object> map = jmeterService.listRpc(name);
        return map;
    }

}

